Monadic, Prompt Lazy Assertions in Haskell
نویسندگان
چکیده
Assertions test expected properties of run-time values without disrupting the normal computation of a program. We present a library for enriching Haskell programs with assertions. Expected properties can be specified in a parser-combinator like language. The assertions are lazy: they do not force evaluation but only examine what is evaluated by the program. They are also prompt: assertion failure is reported as early as possible. The implementation is based on lazy observations and continuation-based coroutines.
منابع مشابه
A Pattern Logic for Prompt Lazy Assertions in Haskell
Assertions test expected properties of run-time values without disrupting the normal computation of a program. Here we present a library for enriching programs in the lazy language Haskell with assertions. Expected properties are written in an expressive pattern logic that combines pattern matching with logical operations and predicates. The presented assertions are lazy: they do not force eval...
متن کاملLazy Assertions
Assertions test expected properties of run-time values without dissrupting the normal working of a program. So in a lazy functional language assertions should be lazy — not forcing evaluation, but only examining what is evaluated by other parts of the program. We describe two different ways of embedding lazy assertions in Haskell, one sequential and the other concurrent. Examples illustrate the...
متن کاملMonadic I/o in Haskell 1.3
We describe the design and use of monadic I/O in Haskell 1.3, the latest revision of the lazy functional programming language Haskell. Haskell 1.3 standardises the monadic I/O mechanisms now available in many Haskell systems. The new facilities allow more sophisticated text-based application programs to be written portably in Haskell. Apart from the use of monads, the main advances over standar...
متن کاملTransforming Functional Logic Programs into Monadic Functional Programs
We present a high-level transformation scheme to translate lazy functional logic programs into pure Haskell programs. This transformation is based on a recent proposal to efficiently implement lazy non-deterministic computations in Haskell in a monadic style. We build on this work and define a systematic method to transform lazy functional logic programs into monadic programs with explicit shar...
متن کاملA Monadic Semantics for Core Curry 1
We give a deterministic, big-step operational semantics for the essential core of the Curry language, including higher-order functions, call-by-need evaluation, nondeterminism, narrowing, and residuation. The semantics is structured in modular monadic style, and is presented in the form of an executable interpreter written in Haskell. It uses monadic formulations of state, non-determinism, and ...
متن کامل